package com.design.mode.command;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2023-04-12 11:06:14
 */
public class OffCommand implements Command{

    private final Receiver receiver;

    public OffCommand(Receiver receiver) {
        this.receiver = receiver;
    }

    @Override
    public boolean execute() {
        receiver.off();
        return true;
    }

    @Override
    public boolean undo() {
        receiver.on();
        return true;
    }

}
